﻿using System.Linq;
using LINQtoFxCop.Core;

namespace LINQtoFxCop.Metrics
{
  public static class NamespaceMetrics
  {
    public static int NbILInstructions(this Namespace @namespace)
    {
      return @namespace.Types.Sum(type => type.NbILInstructions());
    }
    public static int NbTypes(this Namespace @namespace)
    {
      return @namespace.Types.Count();
    }
    public static int NbMethods(this Namespace @namespace)
    {
      return @namespace.Types.Sum(type => type.NbMethods());
    }
    public static int NbFields(this Namespace @namespace)
    {
      return @namespace.Types.Sum(type => type.NbFields());
    }
  }
}
